#include "Fleet.h"

Fleet::Fleet(){
}


void Fleet::addShip(string ship){
	ships.push_back(ship);
}

Fleet::Fleet(const Fleet &p){
	//const char * m = p.getMission();
	strcpy(mission,p.getMission());
	strcpy(source,p.getSource());
	strcpy(destination,p.getDestination());
	strcpy(impacttime,p.getImpacttime());
	strcpy(secondleft,p.getSecondleft());
	const vector<string> s = p.getShips();
	ships =s;
}

const vector<string> Fleet::getShips() const{
	return ships;
}


Fleet::~Fleet(){
	/*for (int i=0; i < ships.size(); i++){
		delete &ships[i];
	}*/
	ships.clear();
}

void Fleet::toString(){
	unsigned int i;
	NF_WriteText(0, 0, 0,0, mission);
	NF_WriteText(0, 0, 0,1, source);
	NF_WriteText(0, 0, 0,2, destination);
	NF_WriteText(0, 0, 0,3, impacttime);
	for (i=0; i < ships.size(); i++){
		const char *p;
		p=ships[i].c_str();
		NF_WriteText(0, 0, 0,4 + i, p);
	}
	//int t = ships.size();
	//NF_WriteText(0, 0, 0,4 + t , "--------");
	NF_UpdateTextLayers();
	
}

const char * Fleet::getMission() const{
	return mission;
}

void Fleet::setMission(char* m){
	strcpy(mission,m);
}

void Fleet::setSource(char* s){
	strcpy(source,s);
}

const char * Fleet::getSource() const{
	return source;
}

void Fleet::setImpacttime(char* i){
	strcpy(impacttime,i);
}

const char * Fleet::getImpacttime() const{
	return impacttime;
}

void Fleet::setDestination(char* d){
	strcpy(destination,d);
}

const char * Fleet::getDestination() const{
	return destination;
}

void Fleet::setSecondleft(char* s){
	strcpy(secondleft,s);
}

const char * Fleet::getSecondleft() const{
	return secondleft;
}
